import { defineConfig } from "vite"
import { resolve } from "path"
import dts from "vite-plugin-dts"

export default defineConfig({
  define: { 'process.env': process.env },
  resolve: {
    alias: {
      '@': `${process.cwd()}/src`,
    }
  },
  build: {
    minify: "esbuild",
    lib: {
      entry: resolve(__dirname, './src/index.ts'),
      name: '@uai-team/uai-editor-common',
      fileName: `index`,
      formats: ['es', 'cjs']
    }
  },
  plugins: [
    dts({ rollupTypes: true })
  ]
})